package com.winshare.saleAssistant.util;



import com.winshare.saleAssistant.constant.HashConstant;
import org.apache.shiro.crypto.hash.SimpleHash;

/**
 * @author terry
 * @date 18-6-14
 */
public final class PwdHashUtils {

    private PwdHashUtils() {
    }

    /**
     * 当前系统密码统一hash实现
     * @param password
     * @param salt
     * @return
     */
    public static String hash(String password, String salt) {
        SimpleHash simpleHash = new SimpleHash(
                HashConstant.ALGORITHM_NAME,
                password,
                salt,
                HashConstant.HASH_ITERATIONS);
        return simpleHash.toString();
    }
}
